package zhang.lao.console.controller.search;/**
 * Created by zhangqin on 2017/11/6.
 */

import com.arronlong.httpclientutil.exception.HttpProcessException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import zhang.lao.extents.spring.exception.ConsoleException;
import zhang.lao.pojo.console.resp.HttpResult;
import zhang.lao.pojo.console.resp.HttpResultEnum;
import zhang.lao.pojo.console.resp.HttpResultUtil;
import zhang.lao.service.search.SearchService;

import javax.annotation.Resource;

/**
 * @author
 * @create 2017-11-06 14:05
 **/

@Controller
public class EsSearch {

    @Resource
    private SearchService searchService;

    @RequestMapping("/console/es/rounting")
    public @ResponseBody HttpResult synSearch(){
        try {
            return searchService.rounting();
        } catch (HttpProcessException e) {
            throw new ConsoleException(HttpResultEnum.FAIL);
        }
    }

}
